<?php
namespace api\jeu\map;

class SimpleCases implements iCases{

	private $_objects = array();
	
	public function addObject($type, $obj) {
		$this->_objects[$type] = $obj;
	}
	
	public function getObject($type) {
		return $this->_objects[$type];
	}
	
	public function removeObject($type) { 
		unset($this->_objects[$type]);
	}
	
	public function toString() { 
		$buffer=null;
		
		foreach($this->_objects as $key => $obj){
			$buffer .= '['.$key.':'.$obj.']';
		}
		
		return $buffer;
	}
	
	public function flush() { 
		unset($this->_objects);
		$this->_objects = null;
		$this->_objects = array();
	}
}
?>